<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
    <title>Spring Security Example </title>
</head>
<body>
<div id="app">
    <div><label> User Name : <input type="text" v-model="username"/> </label></div>
    <div><label> Password: <input type="password" v-model="password"/> </label></div>
    <div><button @click="submit" />submit</div>
</div>
<script>
    new Vue({
        el: '#app',
        data: {
            username: '',
            password: ''
        },
        methods: {
            submit() {
                axios.post('http://localhost:8085/security/user/login', {
                    username: this.username,
                    password: this.password
                })
                    .then(function (response) {
                        console.log(response);
                    })
                    .catch(function (error) {
                        console.log(error);
                    });
            }
        }
    })
</script>
</body>
</html>